#include"shared_command.hpp"



int main()
{

    int fd=open(FIFLNAME,O_WRONLY);
    if(fd<0)
    {
        cerr<<"client open FIFO write error! error:"<<errno<<"errstring:"<<strerror(errno)<<endl;
        return 1;
    }

    cout<<"please input:"<<endl;

    string ss;
    while(true)
    {
        getline(cin,ss);
        ssize_t n = write(fd,ss.c_str(),ss.size());
        if(n<0)
        {
            cerr<<"client write error! errno:"<<errno<<"errstring:"<<strerror(errno)<<endl;
            break;
        }
    }

    close(fd);
    cout<<"clinet close FIFO succeed!"<<endl;

    cout<<"clinet exit!"<<endl;
}